import { createApp, reactive } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
// createApp(App).mount('#app')
import "@/assets/iconfont/iconfont.css"

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
//状态类型数据
const statusOptions = reactive(
  [
    {
      value:1,
      label:'正常',
      color:'#67c23a',
      type:'primary'
    },
    {
      value:2,
      label:'关闭',
      color:'#f56c6c',
      type:'error'
    }
  ]
);
app.config.globalProperties.$statusOptions = statusOptions; 

//用户类型数据
const userTypeOptions = reactive(
  [
    {
      value:1,
      label:'设备填报人员',
      color:'#67c23a',
      type:'info'
    },
    {
      value:2,
      label:'信息员',
      color:'#f56c6c',
      type:'primary'
    },
    {
      value:3,
      label:'监理人员',
      color:'#f56c6c',
      type:'warning'
    },
    {
      value:4,
      label:'系统人员',
      color:'#f56c6c',
      type:'primary'
    }
  ]
);
app.config.globalProperties.$userTypeOptions = userTypeOptions; 

//用户类型数据
const reasonTypeOptions = reactive(
  [
    
    {
      value:1,
      label:'开机原因',
      color:'#f56c6c',
      type:'primary'
    },
    {
      value:2,
      label:'停机原因',
      color:'#f56c6c',
      type:'warning'
    }
  ]
);
app.config.globalProperties.$reasonTypeOptions = reasonTypeOptions; 

//用户类型数据
const sexOptions = reactive(
  [
    {
      value:1,
      label:'男',
      color:'#67c23a',
      type:'primary'
    },
    {
      value:2,
      label:'女',
      color:'#f56c6c',
      type:'error'
    }
  ]
);
app.config.globalProperties.$sexOptions = sexOptions; 

import backTop from '@/views/component/back.vue'
app.component('back-top', backTop)

import uploadImages from '@/views/component/uploadImages.vue'
app.component('upload-images', uploadImages)

import { createPinia } from "pinia"
const pinia = createPinia()
app.use(pinia)
app.use(ElementPlus, {
  locale: zhCn,
})
// 全局属性访问方式：this.$globalState.myGlobalVariable 或 getCurrentInstance().appContext.config.globalProperties.$globalState.myGlobalVariable; 在s

app.use(router)
app.mount('#app')
